home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Source Code
/
Libraries
/
Graphic Elements 3
/
GEQTHack
/
GELogo.c
< prev
next >
Wrap
Text File
|
1995-06-13
|
2KB
|
87 lines
/*
GELogo.c
Graphic Elements © 1994 floating sign
Copyright 1994 by Al Evans. All rights reserved.
5/31/94
Modified for MacHack 6/11/94
*/
#include "GELogo.h"
#include "SFXCtrlr.h"
#include "SFXProcs.h"
#include "SFXDissolve.h"
#include "GESound.h"
typedef struct {
Boolean signOn;
RGBColor color[2];
} BlinkRec, *BlinkRecPtr;
BlinkRec logoBlink;
Str255 logoText = "\pGraphic Elements";
Str255 line2 = "\p©1995 by Al Evans";
Boolean LoadLogoScene(GEWorldPtr world)
{
GrafElPtr logoElement;
GrafElPtr secondLine;
short fontNum;
GrafElPtr ctrlr;
GetFNum("\pPalatino", &fontNum);
logoBlink.signOn = false;
logoBlink.color[0].red = 194 << 8;
logoBlink.color[0].green = 194 << 8;
logoBlink.color[0].blue = 0;
logoBlink.color[1].red = 240 << 8;
logoBlink.color[1].green = 240 << 8;
logoBlink.color[1].blue = 46 << 8;
//Create sign
logoElement = NewTextGraphic(world, logoID, logoPlane, 64, 51, srcOr,
fontNum, bold, 36, logoBlink.color[0], logoText);
if (!logoElement) return false;
secondLine = NewTextGraphic(world, logoID+1, logoPlane + 1, 357, 311, srcOr,
fontNum, 0, 14, logoBlink.color[0], line2);
if (!secondLine) return false;
//Set up blinking action
SetCollision(world, logoID, DoLogoHit, 400);
//Dissolve in first line, wipe in second..
ctrlr = DoGESFX(world, 'SFX ', logoElement, SFXDissolve, geDissolveSteps, 2000, 60, true, true);
GEScheduleSound((GESoundPtr) world->userData, 500, 2, 2000);
ctrlr = DoGESFX(world, 'SFX1', secondLine, SFXHWipe, 20, 5000, 60, true, false);
GEHoldSound((GESoundPtr) world->userData, 600, true);
return true;
}
pascal void DoLogoHit(GEWorldPtr world, GrafElPtr logo, GEDirection dir,
CollisionPhase phase, GrafElPtr objHit)
{
switch (phase) {
case collisionBegin:
GEScheduleSound((GESoundPtr) world->userData, 600, 2, 0);
((TextGraphicPtr) logo)->tgColor = logoBlink.color[true];
ChangedRect(world, &logo->animationRect);
break;
case collisionContinue:
break;
case collisionEnd:
((TextGraphicPtr) logo)->tgColor = logoBlink.color[false];
ChangedRect(world, &logo->animationRect);
GEStopOneSound((GESoundPtr) world->userData, 600);
break;
}
}